
class Animal {
    private String name;
    private int age;
    public final String COLOR = "黑色";

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

class Dog extends Animal {
    // Dog 类可以继承 Animal 类的方法和属性，无需额外代码
}

public class demo1 {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.setName("牧羊犬");
        dog.setAge(3);
        System.out.println("名称：" + dog.getName() + "，年龄：" + dog.getAge() + "，颜色：" + dog.COLOR);
    }
}